﻿/*
Name:digger_url
Author: Terry Dong
Description: data access layer
*/
using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Reflection;
using Gammar.Digger.IDAL;

namespace Gammar.Digger.DALFactory
{

    public partial class DataAccess
    {
        //initialize dal reflect path
        private static readonly string dalSqlServer = ConfigurationManager.AppSettings["DALSqlServer"];
        private static readonly string dalOracle = ConfigurationManager.AppSettings["DALOracle"];
        private static readonly string dalMySql = ConfigurationManager.AppSettings["DALMySql"];

        private static string className = string.Empty;


        /// <summary>
        /// create comment_data instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Icomment_data Createcomment_data()
        {
            className = dalSqlServer + ".comment_data";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Icomment_data);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Icomment_data Createcomment_data(string newConn)
        {
            className = dalSqlServer + ".comment_data";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Icomment_data);
        }
        /// <summary>
        /// create digger_plugin instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Idigger_plugin Createdigger_plugin()
        {
            className = dalSqlServer + ".digger_plugin";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Idigger_plugin);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Idigger_plugin Createdigger_plugin(string newConn)
        {
            className = dalSqlServer + ".digger_plugin";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Idigger_plugin);
        }
        /// <summary>
        /// create digger_sourceData instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Idigger_sourceData Createdigger_sourceData()
        {
            className = dalSqlServer + ".digger_sourceData";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Idigger_sourceData);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Idigger_sourceData Createdigger_sourceData(string newConn)
        {
            className = dalSqlServer + ".digger_sourceData";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Idigger_sourceData);
        }
        /// <summary>
        /// create digger_url instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Idigger_url Createdigger_url()
        {
            className = dalSqlServer + ".digger_url";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Idigger_url);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Idigger_url Createdigger_url(string newConn)
        {
            className = dalSqlServer + ".digger_url";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Idigger_url);
        }
        /// <summary>
        /// create error_type instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Ierror_type Createerror_type()
        {
            className = dalSqlServer + ".error_type";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Ierror_type);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Ierror_type Createerror_type(string newConn)
        {
            className = dalSqlServer + ".error_type";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Ierror_type);
        }
        /// <summary>
        /// create plugin_run_log instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Iplugin_run_log Createplugin_run_log()
        {
            className = dalSqlServer + ".plugin_run_log";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Iplugin_run_log);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Iplugin_run_log Createplugin_run_log(string newConn)
        {
            className = dalSqlServer + ".plugin_run_log";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Iplugin_run_log);
        }
        /// <summary>
        /// create plugin_run_status instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Iplugin_run_status Createplugin_run_status()
        {
            className = dalSqlServer + ".plugin_run_status";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Iplugin_run_status);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Iplugin_run_status Createplugin_run_status(string newConn)
        {
            className = dalSqlServer + ".plugin_run_status";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Iplugin_run_status);
        }
        /// <summary>
        /// create System_config instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static ISystem_config CreateSystem_config()
        {
            className = dalSqlServer + ".System_config";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as ISystem_config);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static ISystem_config CreateSystem_config(string newConn)
        {
            className = dalSqlServer + ".System_config";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as ISystem_config);
        }
        /// <summary>
        /// create system_logs instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Isystem_logs Createsystem_logs()
        {
            className = dalSqlServer + ".system_logs";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Isystem_logs);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Isystem_logs Createsystem_logs(string newConn)
        {
            className = dalSqlServer + ".system_logs";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Isystem_logs);
        }
        /// <summary>
        /// create System_status instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static ISystem_status CreateSystem_status()
        {
            className = dalSqlServer + ".System_status";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as ISystem_status);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static ISystem_status CreateSystem_status(string newConn)
        {
            className = dalSqlServer + ".System_status";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as ISystem_status);
        }
        /// <summary>
        /// create web_site instance(defalut),SqlServer
        /// </summary>
        /// <returns></returns>
        public static Iweb_site Createweb_site()
        {
            className = dalSqlServer + ".web_site";

            return (Assembly.Load(dalSqlServer).CreateInstance(className) as Iweb_site);
        }

        /// <summary>
        /// create new Customers instance (new connectionString),SqlServer
        /// </summary>
        /// <param name="newConn">new connectionString name</param>
        /// <returns></returns>
        public static Iweb_site Createweb_site(string newConn)
        {
            className = dalSqlServer + ".web_site";

            return (Assembly.Load(dalSqlServer).CreateInstance(className, false, BindingFlags.Default, null, new object[] { newConn }, null, null) as Iweb_site);
        }


    }
}